package com.thethinkfactory.whosappfor.model.db;

import android.database.sqlite.SQLiteDatabase;

public class TableVote {
	public static final String TABLE_NAME = "vote";
	public static final String COLUMN_ID = "_id";
	public static final String COLUMN_FOR_EVENT = "forevent";
	public static final String COLUMN_BY_USER = "byuser";

	private static final String TABLE_CREATE = "create table " + TABLE_NAME
			+ " (" + COLUMN_ID + " integer primary key autoincrement, "
			+ COLUMN_FOR_EVENT + " integer not null, " + COLUMN_BY_USER
			+ " integer not null);";

	public static void onCreate(SQLiteDatabase database) {
		database.execSQL(TABLE_CREATE);
	}

	public static void onUpgrade(SQLiteDatabase database, int oldVersion,
			int newVersion) {
		database.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
		onCreate(database);
	}
}
